package org.veridiandynamics.server.model;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.veridiandynamics.server.domain.Appointment;
import org.veridiandynamics.server.domain.Doctor;
import org.veridiandynamics.server.domain.Patient;
import org.veridiandynamics.server.domain.TreatmentRecord;

public class NurseModel {
	
	public void createPatient(String username, String password, Map<String, String> personalInfo, 
			Doctor doctor, List<TreatmentRecord> recordList, String pharmacy, 
			String insuranceCarrier, String allergies) {
		Patient newPatient = new Patient(username, password, personalInfo, doctor, 
				recordList, pharmacy, insuranceCarrier, allergies);
		PatientModel patientModel = new PatientModel();
		patientModel.createPatient(newPatient);
	}

	public void createPatient(Patient patient) {
		PatientModel patientModel = new PatientModel();
		patientModel.createPatient(patient);
	}
	
	
	public void deletePatient(String username, String password, Map<String, String> personalInfo, 
			Doctor doctor, List<TreatmentRecord> recordList, String pharmacy, 
			String insuranceCarrier, String allergies) {
		Patient oldPatient = new Patient(username, password, personalInfo, doctor, 
				recordList, pharmacy, insuranceCarrier, allergies);
		//TODO hook up to the DAO from here
	}
	public void deletePatient(Patient patient) {
		//TODO hook up to the DAO from here
	}
	
	public List<Patient> lookupPatient(Patient patient) {
		PatientModel patientModel = new PatientModel();
		List<Patient> patientLookup = patientModel.retrievePatient(patient);
		return patientLookup;
	}
	
	public void createNewPatientTreatmentRecord(TreatmentRecord record, Patient patient) {
		List<TreatmentRecord> medicalHistory = patient.getTreatmentRecordList();
		medicalHistory.add(record);
		//TODO hook up to the DAO from here
		
	}
	
	public List<Appointment> retrieveDailyAppointments(Date date) {
		AppointmentModel appointmentModel = new AppointmentModel();
		return appointmentModel.retrieveDailyAppointments(date);
	}
}
